/*--------------------------------------------------------------------------------------*\
**
** t_adventure_event_playback.h
**
** Heroes IV
** Copyright 2000, The 3DO Company
**
\*--------------------------------------------------------------------------------------*/

#if !defined( ADVENTURE_EVENT_PLAYBACK_H_INCLUDED)
#define ADVENTURE_EVENT_PLAYBACK_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "adventure_events_base.h"
#include "counted_ptr.h"
#include "idle_processor.h"

// --------------------------------------------------------------------------
// t_adventure_event_playback class : this class does the playback of all the events within its 
// events_list passed into its constructor.
// --------------------------------------------------------------------------

class t_adventure_event_playback : public t_counted_object, public t_idle_processor
{
public:
	// Constructor
	t_adventure_event_playback( t_adventure_event_list const &	events_list );
	
	void adventure_event_finished( t_adventure_event_base * event);
	
	void attach( t_adventure_map *  map );
	void set_player_turn ( int player_turn );
	
	void start();
	void stop();

protected:

	t_adventure_event_list const &			m_events_list;
	t_adventure_event_list::const_iterator	m_current_event;
	
	t_adventure_map	*						m_map;
	
	int										m_player_turn;
	
private:
	
	virtual void on_idle();

};

typedef t_counted_ptr<t_adventure_event_playback> t_adventure_event_playback_ptr;

#endif // ADVENTURE_EVENT_PLAYBACK_H_INCLUDED

